/*
 *  WellTemperedNotes.h
 *  
 *
 *  Created by jiro on 10/02/15.
 *  Copyright 2010 jiro music. All rights reserved.
 *
 */

#pragma once

#include <cmath>
#include "Note.h"

namespace sc {

class WellTemperament
{
public:

	static const double calculationError = 0.00001;

public:

	static double baseFrequency;

public:
	
	static double GetFrequency( Note::Id noteId, int octave );
	
	static double GetFrequency( Note::MidiNumber number );

	static void GetNotIdAndOctave( double frequency, Note::Id& noteId, int& octave );
	
	static Note::MidiNumber GetMidiNoteNumber( double frequency );

	static bool IsEqual( double v0, double v1 );

};

}
